import request from '@/utils/request'



// 登陆
export function login(param) {
    return request({
        url: '/van/v1/login/in',
        method:'POST',
        params:param
    })
}

// 加载车销分类
export function getVanTypeList() {
    return request({
        url: '/van/v1/productTypes',
        method:'GET'
    })
}

//加载分类下的产品列表
export function getTypeProducts(typeId) {
    let param = {typeId:typeId} ;
    return request({
        url: '/van/v1/typeProducts',
        method:'GET',
        params:param
    })
}
//加入购物车
export function updateToCart(param) {
    console.log('param:',param);
    return request({
        url: '/van/v1/shopCart/update',
        method:'POST',
        params:param
    })
}

//购物车列表
export function shopCartList() {
    return request({
        url: '/van/v1/shopCart/list',
        method:'GET',
    })
}

//删除购物车商品
export function deletedShopCart(param) {
    return request({
        url: '/van/v1/shopCart/deleted',
        method:'GET',
        params:param
    })
}

//修改购物车商品购买方式
export function updateSaleType(param) {
    return request({
        url: '/van/v1/shopCart/updateSaleType',
        method:'GET',
        params:param
    })
}

//创建订单
export function createOrder(param) {
    return request({
        url: '/van/v1/order/create',
        method:'POST',
        params:param
    })
}


//订单明细
export function orderDetail(param) {
    return request({
        url: '/van/v1/order/detail',
        method:'GET',
        params:param
    })
}

//订单详情
export function orderItem(param) {
    return request({
        url: '/van/v1/order/item',
        method:'GET',
        params:param
    })
}

//订单列表
export function orderList(param) {
    return request({
        url: '/van/v1/order/list',
        method:'GET',
        params:param
    })
}

//订单统计
export function orderCount() {
    return request({
        url: '/van/v1/home/count',
        method:'GET'
    })
}

//删除订单
export function deletedOrder(param) {
    return request({
        url: '/van/v1/order/deleted',
        method:'GET',
        params:param
    })
}

//订单支付
export function toPay(param) {
    return request({
        url: '/van/v1/order/payBack',
        method:'POST',
        params:param
    })
}






